package org.service;

import org.dao.UserDao;
import org.entity.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.HashMap;
import java.util.Map;

/**
 * Created by dengry on 15/1/21.
 */
@Service("userService")
public class UserServiceImpl implements UserService {
    @Autowired
    private UserDao userDao;

    @Override
    public User getUserByUsernameAndPassword(String username, int password) {
        Map<String, Object> param = new HashMap<String, Object>();
        param.put("userName", username);
        param.put("password", password);
        User u = userDao.findByUserNameAndPassWord(param);
        return u;
    }
}
